﻿--网站日志列表
CREATE proc [dbo].[proc_SiteLog_GetList]
(
	@sid int
)	
as
	select 
		sl.id,
		sl.sid,
		(select sf.customername from siteform sf where sf.id=@sid) as customername,
		(select e.ename from employee e where sl.username=e.username) as username,
		sl.createtime,
		sl.[log],
		sl.stateid,
		(select ss.title from sitestate ss where sl.stateid=ss.id) as StateName,
		(select dname from department where id = (select e.departmentid from employee e where e.username=sl.username)) as departmentname
	from
		sitelog sl
	where
		sl.sid = @sid
